/**
 * Craeted with IntelliJ IDEA.
 * Description:
 * User:23687
 * Date:2024-09-21
 * Time:16:00
 */

import java.util.Random;
import java.util.Scanner;

public class TestDemo1 {

    public static void main(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int Guess = random.nextInt(100);
        while (true) {
            System.out.println("输入一个1-100的数字");
            int num = sc.nextInt();
            if (num > Guess) {
                System.out.println("猜大了");
            }
            else if (num == Guess) {
                System.out.println("猜对了");
                break;
            }
            else{
                System.out.println("猜小了");
            }
        }
        sc.close();
    }

}
